<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app1"></div>
  <div id="app2"></div>

  <script src="../js/react.development.js"></script>
  <script src="../js/react-dom.development.js"></script>
  <script src="../js/babel.min.js"></script>

  <script type="text/babel">



    class Person extends React.Component{

      
      render(){
        console.log(this);
        return (
          <ul>
            <li>姓名：{this.props.name}</li>
            <li>性别：{this.props.sex}</li>
            <li>年龄：{this.props.age+1}</li>
          </ul>
        )
      }
    }

    ReactDOM.render(<Person name="tom" age={18} sex="女"/>,document.getElementById("app1"))
    const p = {name:'l老刘',age:25,sex:'男'}
    ReactDOM.render(<Person {...p}/>,document.getElementById("app2"))

  </script>
</body>
</html>